const tabSpaceCount = 2;
const headings = [
    "保险业务知识学习",
    "  O32系統知识",
    "  O45系統知识",
    "投资交易业务知识学习",
    "IT知识学习",
    "IT开发笔记",
    "数学知识学习"]

const headingsLevel = headings.map(item => {
    return item.match(/^ */)[0].length / tabSpaceCount + 1;
});
const headingsTitle = headings.map((item, idx) => {
    return " ".repeat((headingsLevel[idx]-1) * tabSpaceCount) +`${idx + 1}.${item.trim()}`
});
// const choice = await tp.system.suggester(headingsTitle, headings);
choiceIndex = headings.findIndex(item => item === "  O45系統知识");
console.log(headingsTitle);
choice = headings[choiceIndex];
if (choice) {
    let output = "#".repeat(headingsLevel[choiceIndex]) + `### ${choice.trim()}`;
    console.log(output);
}
// console.log(headings2)